@extends('index.layout.main')

@section('content')
    <!--shop  area start-->
    <div class="shop_area shop_reverse mt-100 mb-100">
        <div class="container">
            <div class="row">
                <div class="col-lg-3 col-md-12">
                    @include('index.layout._aidebar')
                </div>
                <div class="col-lg-9 col-md-12">
                    <!--shop wrapper start-->
                    <!--shop toolbar start-->
                    <div class="shop_toolbar_wrapper">

                        <div class=" niceselect_option">
                            <form class="" action="">
                                <div class="coupon_inner">
                                    <input placeholder="输入关键字搜索" name="keyword" value="{{ request('keyword') }}" type="text">
                                    <input  name="type" value="{{ request('type') }}" type="hidden">
                                    <button type="submit">搜索</button>
                                </div>
                            </form>
                        </div>
                        <div class="page_amount">
                            <p>共{{ $lists->lastPage() }}页{{ $lists->total() }}条</p>
                        </div>
                    </div>
                    <!--shop toolbar end-->
                    <div class="row shop_wrapper">
                        @if($lists->isNotEmpty())
                            @foreach($lists as $item)
                                <div class="col-lg-4 col-md-4 col-sm-6 col-12 ">
                                    <article class="single_product">
                                        <figure>
                                            <div class="product_thumb">
                                                <div class="label_product">
                                                    {{--<span class="label_new">新上</span>--}}
                                                    {{--<span class="label_sale">0%</span>--}}
                                                </div>
                                                <a class="primary_img" href="{{ url('/show',['id'=>$item->id]) }}"><img src="{{ $item['img'][0] or '' }}" alt=""></a>
                                                <a class="secondary_img" href="{{ url('/show',['id'=>$item->id]) }}"><img src="{{ !empty($item['img'][1]) ? $item['img'][1] : $item['img'][0]}}" alt=""></a>

                                            </div>
                                            <div class="product_content grid_content">
                                                <div class="product_rating">
                                                    扫描二维码，复制到淘宝下单
                                                    <br>
                                                    ------------------
                                                </div>
                                                <h4 class="product_name">
                                                    <a href="{{ url('/show',['id'=>1]) }}">{{ $item->name or '' }}
                                                    </a>
                                                </h4>
                                                <div class="price_box">
                                                    <span class="current_price">{{ $item['price']-$item['coupon'] }}</span>
                                                    <span class="old_price">{{ $item['price'] or '' }}</span>
                                                </div>
                                            </div>
                                        </figure>
                                    </article>
                                </div>
                            @endforeach
                            @endif



                    </div>

                    <div class="shop_toolbar t_bottom">
                        <div class="pagination">
                            @if($lists->isNotEmpty())
                                {!! $lists->appends(request()->all()) !!}
                                @endif
                        </div>
                    </div>
                    <!--shop toolbar end-->
                    <!--shop wrapper end-->
                </div>
            </div>
        </div>
    </div>
    <!--shop  area end-->

@endsection